﻿using SharpDX.Direct3D11;

namespace Engine.Graphics.Shaders.C11Undercover
{
    public class StandardEffect : ShaderBase, ISetShaderValues
    {
        #region Private Fields

        private string name;
        private ShaderResourceView texture;

        #endregion Private Fields

        #region Public Constructors

        public StandardEffect(Device device)
            : base(device)
        {
            try
            {
                var startupFolder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                string filename = startupFolder + @"\Shaders\C11Undercover\Alpha.dds";

                this.texture = ShaderResourceView.FromFile(device, filename);
            }
            catch (System.Exception)
            {
                System.Console.WriteLine("File not found: ");
            }
        }

        #endregion Public Constructors

        #region Public Properties

        public ShaderBase Effect
        {
            get { return base.effect; }
        }

        public string Name
        {
            get
            {
                return "Standard Effect";
            }
            set
            {
                this.name = value;
            }
        }

        #endregion Public Properties

        #region Public Methods

        public new void Dispose()
        {
            if (this.texture != null)
            {
                this.texture.Dispose();
                this.texture = null;
            }
            //if (this.effect != null)
            //{
            //    this.effect.Dispose();
            //    this.effect = null;
            //}
        }

        public void SetProperties(int materialID, MaterialManager materialManager)
        {
        }

        #endregion Public Methods
    }
}